package com.efast.dmom.mes.bean;

import java.util.List;

import com.efast.dmom.mes.bean.base.PartRelateBaseBean;
import com.efast.dmom.mes.datahandlers.entity.PartDataHandler;
import com.efast.dmom.mes.entity.BomItemEntity;

/**
 * 
 * @author wj
 * @Date 2020/1/9 14:06
 *
 */
public class BomItem extends PartRelateBaseBean<BomItemEntity> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7438235944278493369L;

	private List<BomItemAlternate> itemsAlternate;
	
	private Part part;

	public List<BomItemAlternate> getItemsAlternate() {
		return itemsAlternate;
	}

	public void setItemsAlternate(List<BomItemAlternate> itemsAlternate) {
		this.itemsAlternate = itemsAlternate;
	}

	public Part getPart() {
		if(part ==null) {
			String partNo = getInnerData().getPartNo();
			String partRevision = getInnerData().getPartRevision();
			return getService(PartDataHandler.class).getPartByPartNo(partNo, partRevision);
			
		}else {
			return part;
		}
	}

	public void setPart(Part part) {
		this.part = part;
	}
}
